package com.example.springbootgraduation.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.springbootgraduation.entity.LineTrend;
import com.example.springbootgraduation.entity.NocvData;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface IndexMapper extends BaseMapper<NocvData>{//继承

    /**
     * 折线图
     * 接口：只有方法定义，并没有写业务逻辑
     * 1、实现类，业务逻辑
     * 2、xml mybatisplus 任意一种实现
     * 3、本项目使用注解形式实现 @select
     * @return
     */
    @Select("select * from line_trend order by create_time DESC limit 7")
    List<LineTrend> findSevenData();

    @Select("select * from nocv_data order by id desc limit 34")
    List<NocvData> listOrderByIdLimit34();//倒叙取34条数据
}
